package com.example.asus.testskip.DGPhone.phone;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.widget.TextView;

import com.example.asus.testskip.DGPhone.GlowingText;
import com.example.asus.testskip.R;


/* renamed from: dg.ca.com.DGPhone.phone.OverLayActivity */
public class OverLayActivity extends Activity {
    public static final String ACTION_END_CALL = "com.dg.phoneshow.ACTION_END_CALL";
    public static final String EXTRA_PHONE_NUM = "phoneNum";
    public static final int MSG_FAILED = 4097;
    public static final int MSG_OK = 4096;
    @SuppressLint({"HandlerLeak"})
    private Handler handler = new Handler() {
        public void handleMessage(Message msg) {
        }
    };
    private BroadcastReceiver mEndCallReceiver = new BroadcastReceiver() {
        public void onReceive(Context context, Intent intent) {
            if (intent != null && intent.getAction().equals(OverLayActivity.ACTION_END_CALL)) {
                OverLayActivity.this.finish();
            }
        }
    };
    private Title mTitle = null;
    private String phoneNum = "";
    private Intent scrOnIntent = null;

    /* access modifiers changed from: protected */
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setFlags(1024, 1024);
        requestWindowFeature(1);
        setContentView(R.layout.call_over_layout);
        Log.i("我的信息", "overlay创建");
        this.scrOnIntent = new Intent(this, ScreenService.class);
        startService(this.scrOnIntent);
        if (getIntent().hasExtra("phoneNum")) {
            this.phoneNum = getIntent().getStringExtra("phoneNum");
        }
        initView();
        addListener();
        registerReceiver(this.mEndCallReceiver, new IntentFilter(ACTION_END_CALL));
    }

    private void initView() {
        this.mTitle = (Title) findViewById(R.id.overlay_title);
        this.mTitle.setTitle((CharSequence) "来电");
        try {
            TextView phoneText = (TextView) findViewById(R.id.overlay_result_msg);
            phoneText.setText(this.phoneNum);
            new GlowingText(this, getBaseContext(), phoneText, 24.0f, 24.0f, 25.0f, -1, 1);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private void addListener() {
    }

    /* access modifiers changed from: protected */
    public void onStop() {
        stopService(this.scrOnIntent);
        super.onStop();
    }

    /* access modifiers changed from: protected */
    public void onDestroy() {
        try {
            unregisterReceiver(this.mEndCallReceiver);
        } catch (Exception e) {
            e.printStackTrace();
        }
        super.onDestroy();
    }
}
